﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Easyui扩展库 Combotree - 落阳 整理</title>
    <link href="http://www.easyui-extlib.com/Content/Site.css" rel="stylesheet" />
    <script src="http://www.easyui-extlib.com/Scripts/jquery/jquery-1.11.0.min.js"></script>
    <script src="http://www.easyui-extlib.com/Scripts/jquery-extensions/jquery.jdirk.js"></script>
    <link href="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/themes/default/easyui.css" rel="stylesheet" />
    <link href="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" />
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>

    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui-extensions/tree/jeasyui.extensions.tree.dataPlain.js"></script>
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui-extensions/combotree/jeasyui.extensions.combotree.js"></script>
    <script>
        $(function () {
            var data = [
                { "id": "1", "text": "A" },
                { "id": "11", "text": "A1", "parendId": 1 },
                { "id": "12", "text": "A2", "parendId": 1 },
                { "id": "13", "text": "A3", "parendId": 1 },
                { "id": "2", "text": "B" },
                { "id": "3", "text": "C" }
            ];

            $("#combotree").combotree({
                dataPlain: true, //继承于 easyui-tree 的扩展
                parentField: "parendId", //继承于 easyui-tree 的扩展
                data: data,
                onClick: function (node) {
                    $("#span").text("点击了节点：" + node.text);
                }
            });
        });
    </script>
</head>
<body>
    <div class="easyui-panel" data-options="fit:true,border:false" style="padding:25px;">
        <input id="combotree" name="combotree" type="text" />
        <br /><br /><br />
        <span id="span" style="color:red;"></span>
    </div>
</body>
</html>
